<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <style>
        .content{
            margin-top: 50px;
        }

        .insert-user-button{
            margin: 20px;
            height: 30px;
            width: 80px;
            line-height: 30px;
            text-align: center;
            background-color: #3838e2;
            color: #ffffff;
            border: none;
            float: right;
        }

        .table{
            width: 100%;
            border-collapse: collapse;
        }

        .table th{
            background-color: #49496e;
            border: 1px solid #efefef;
            color: #ffffff;
        }

        .table td{
            border: 1px solid #efefef;
            text-align: center;
        }
    </style>
</head>
<div th:replace="common/head"></div>
<body>
    <div class="content">
        <button class="insert-user-button">创建用户</button>
        <table class="table">
            <thead>
                <tr>
                    <th>用户ID</th>
                    <th>用户昵称</th>
                    <th>注册时间</th>
                    <th>用户账号</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="user, userStat : ${userList}">
                    <td th:text="${user.userId}"></td>
                    <td th:text="${user.nickname}"></td>
<!--                    <td th:text="${user.createtime}"></td>-->
                    <td th:text="${#dates.format(user.createtime, 'yyyy-mm-dd HH:MM:ss')}"></td>
                    <td th:text="${user.username}"></td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
<script>
    $(".insert-user-button").click(function (){
        // 新增用户
        window.open("insertUser");
    })
</script>
</html>